package com.practice.java8中双冒号方法引用如何使用;
import lombok.ToString;
/**
 * @program: tenghw-practice-demo
 * @author: tenghw
 * @create: 2024-01-06 13:54
 * @Version 1.0
 * @description:
 **/
@ToString
public class Student {
    public String name;
    public Integer age;
    public Student(String name, Integer age) {
        this.name = name;
        this.age = age+1;
    }


    public String getName() {
        return name;
    }
    public Integer getAge() {
        return age;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setAge(Integer age) {
        this.age = age+1;
    }


    protected static void printStudentName(Student student){
        System.out.println("学生姓名："+student.getName());
    }
}